package com.lelouch.concurrency.example.threadLocal;

/**
 * 存储请求中的字段的ThreadLocal
 *
 * @author lcy
 * @create 2018-05-23 17:07
 */
public class RequestHolder {

    private final static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void add(Long id){
        threadLocal.set(id);
    }

    public static Long get(){
        return threadLocal.get();
    }
    public static void remove(){
        threadLocal.remove();
    }



}
